<template>
  <div class="custom-body" :style="borderStyle">
    <div class="body-custom" :style="bodyStyle">
      <div v-if="showHeader && temp.sfxsbt" class="custom-header">
        <div class="header-body">
          <div v-if="temp.sfsxtb === true" class="header-icon">
            <i :class="temp.tb" />
          </div>
          <div class="header-title">
            <span class="title-span">{{ temp.name }}</span>
          </div>
          <div
            v-if="temp.isMore === true"
            class="header-icon more"
            @click="callBack"
          >
            更多
          </div>
        </div>
      </div>
      <div class="custom-content">
        <el-empty
          v-if="dataList === null || dataList.length === 0"
          :image-size="100"
        />
        <div v-else>
          <div
            v-for="(obj, index) in dataList"
            :key="'obj-' + index"
            class="custom-ul-li"
            :loading="loading"
            @click="openEntity(obj)"
          >
            <div class="custom-li-left">
              {{ obj[column['time']] }}
              <div class="custom-left-span">
                {{ obj[column['title']].substring(0, 1) }}
              </div>
            </div>
            <div class="custom-li-right">
              <div class="custom-li-title">{{ obj[column['title']] }}
              </div>
              <div class="custom-li-span">
                <span>{{ obj[column['left']] }}</span>
                <span>{{ obj[column['right']] }}</span>
              </div>
              <div class="right-more"><i class="el-icon-d-arrow-right" /></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { mobile } from '@/mixins/mobile'

export default {
  name: 'AppNewListTempV1', // app学校新闻
  mixins: [mobile({ tabs: 'temp' })]
}
</script>

<style lang="scss" scoped>
.custom-body {
  width: 100%;
  height: 100%;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

.body-custom {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-flow: column nowrap;
}

.custom-header {
  width: 100%;
  height: 50px;
  flex: 0 1 auto;
  padding: 0 10px;
  box-sizing: border-box;
  line-height: 50px;
  cursor: pointer;
}

.header-body {
  width: 100%;
  height: 51px;
  display: flex;
  flex-flow: row nowrap;
}

.header-icon {
  width: 20px;
  height: 50px;
  flex: 0 1 auto;
  text-align: center;
  color: #409eff;
  font-size: 1.1rem;
}

.header-icon.more {
  width: 50px;
  font-size: 0.9rem;
}

.header-title {
  height: 50px;
  flex: 1 1 auto;
  font-size: 0.9rem;
}

.title-span {
  height: 40px;
  padding: 12px 5px;
  box-sizing: border-box;
  line-height: 40px;
  text-align: center;
  position: relative;
  font-weight: bolder;
}

.custom-content {
  width: 100%;
  height: auto;
  flex: 1 1 auto;
  padding: 0 10px 10px 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.custom-ul-li {
  width: 100%;
  height: 60px;
  display: flex;

  .custom-li-left {
    width: 70px;
    line-height: 15px;
    font-size: 0.7rem;
    text-align: left;
    color: #909399;
    border-right: 1px dashed #C0C4CC;
    position: relative;

    .custom-left-span {
      position: absolute;
      width: 20px;
      height: 20px;
      background-color: #00a0e9;
      border-radius: 10px;
      color: #ffffff;
      line-height: 20px;
      font-size: 0.8rem;
      font-weight: bold;
      text-align: center;
      top: 0;
      right: -10px;
    }
  }

  .custom-li-right {
    flex: 1 1;
    padding-left: 12px;
    box-sizing: border-box;
    display: flex;
    flex-flow: column nowrap;
    overflow: hidden;
    position: relative;

    .custom-li-title {
      width: 100%;
      height: 30px;
      line-height: 20px;
      font-size: 0.9rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .custom-li-span {
      width: 100%;
      height: 20px;
      line-height: 20px;
      font-size: 0.8rem;
      color: #909399;
      display: flex;
      justify-content: space-between;
    }

    .right-more {
      width: 20px;
      height: 20px;
      color: #909399;
      text-align: center;
      line-height: 20px;
      position: absolute;
      right: 0;
      top: 50%;
      margin-top: -10px;
      font-size: 0.7rem;
    }
  }
}
</style>
